home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Utilities / PowerWindows / Developper / Include / PWDevelopper.h < prev   
Encoding:
C/C++ Source or Header  |  1997-06-06  |  5.3 KB  |  244 lines

  1. /* PWDevelopper.h */
  2.  
  3. #ifndef EXEC_TYPES_H
  4. #include <exec/types.h>
  5. #endif
  6.  
  7. #ifndef INTUITION_INTUITION_H
  8. #include <intuition/intuition.h>
  9. #endif
  10.  
  11. #ifndef INTUITION_CLASSUSR_H
  12. #include <intuition/classusr.h>
  13. #endif
  14.  
  15. /*=======================================================*/
  16. /*                     Screen-Checker                    */
  17. /*=======================================================*/
  18.  
  19.  
  20.  
  21.   /* Return-Codes */
  22.   
  23. #define CSR_OK 1
  24. #define CSR_FAIL 0
  25.     
  26.   /* Methods */
  27.   
  28. #define CS_INIT 1
  29. #define CS_EXIT 2
  30. #define CS_CHECK 3
  31.    
  32.   /* Messages */
  33.   
  34. struct csInit
  35. {
  36.     ULONG MethodID;
  37.     BYTE  PWVersion;        /* Version of PowerWindows */
  38.     BYTE    PWRevision;        /* Revision of PowerWindows */
  39.     BYTE    PWSubRevision;    /* SubRevision of PowerWindows */
  40.     BYTE    pad;
  41. /* New in V1.0 */
  42.     STRPTR Parameters;    /* READ ONLY!!! */
  43. };
  44.  
  45. struct csExit
  46. {
  47.     ULONG MethodID;    
  48. };
  49.  
  50. struct csCheck
  51. {
  52.     ULONG MethodID;
  53.     struct Screen *Scr;        /* Screen to check */
  54. };
  55.  
  56.  
  57.  
  58.  
  59. /*=======================================================*/
  60. /*                     Window-Checker                    */
  61. /*=======================================================*/
  62.  
  63.  
  64.  
  65.   /* Return-Codes */
  66.   
  67. #define CWR_OK 1
  68. #define CWR_ICONIFYGAD 2
  69. #define CWR_ICONIFYPOS 4
  70. #define CWR_FAIL 0
  71.     
  72.   /* Methods */
  73.   
  74. #define CW_INIT 1
  75. #define CW_EXIT 2
  76. #define CW_CHECK 3
  77. #define CW_RENDERIG 4
  78.  
  79.   /* Messages */
  80.   
  81. struct cwInit
  82. {
  83.     ULONG MethodID;
  84.     BYTE  PWVersion;                /* Version of PowerWindows */
  85.     BYTE    PWRevision;                /* Revision of PowerWindows */
  86.     BYTE    PWSubRevision;            /* SubRevision of PowerWindows */
  87.     BYTE    pad;
  88. /* New in V1.0 */
  89.     STRPTR Parameters;            /* READ ONLY!!! */
  90. };
  91.  
  92. struct cwExit
  93. {
  94.     ULONG MethodID;    
  95. };
  96.  
  97. struct cwCheck
  98. {
  99.     ULONG MethodID;
  100.     struct Window *Win;            /* Window to check */
  101.     WORD    Gad_LeftEdge;            /* LeftEdge of Iconify-Gadget WRITE ONLY! */
  102.     WORD    Gad_TopEdge;            /* TopEdge of Iconify-Gadget  WRITE ONLY! */
  103.     WORD    Gad_Width;                /* Width of Iconify-Gadget    WRITE ONLY! */
  104.     WORD    Gad_Height;                /* Height of Iconify-Gadget   WRITE ONLY! */
  105.     WORD    Gad_Flags;                /* Flags for Gadget: only GFLG_RELRIGHT and GFLG_RELBOTTOM supported upto now! WRITE ONLY */
  106.     WORD    Gad_Position;            /* Position of Gadget in Window's GagetList WRITE ONLY! */
  107. };
  108.  
  109. struct cwRenderIG
  110. {
  111.     ULONG MethodID;
  112.     struct Image *GadImage;            /* Pointer to the Image */
  113.     struct impDraw *DrawImageMsg;    /* Pointer to a a IM_DRAW-Message */
  114. };
  115.  
  116.  
  117.  
  118. /*=======================================================*/
  119. /*                     Icon-Renderer                     */
  120. /*=======================================================*/
  121.  
  122.  
  123.  
  124.   /* Return-Codes */
  125.   
  126. #define RIR_OK 1
  127. #define RIR_FAIL 0
  128.     
  129.   /* Methods */
  130.   
  131. #define RI_INIT 1
  132. #define RI_EXIT 2
  133. #define RI_INITICON 3
  134. #define RI_RENDERICON 4
  135. #define RI_EXITICON 5
  136. #define RI_REFRESHIFRAME 6
  137. #define RI_REFRESHITITLE 7
  138.  
  139.   /* Messages */
  140.   
  141. struct riInit
  142. {
  143.     ULONG MethodID;
  144.     BYTE  PWVersion;                /* Version of PowerWindows */
  145.     BYTE    PWRevision;                /* Revision of PowerWindows */
  146.     BYTE    PWSubRevision;            /* SubRevision of PowerWindows */
  147.     BYTE    pad;
  148. /* New in V1.0 */
  149.     STRPTR Parameters;            /* READ ONLY!!! */
  150. };
  151.  
  152. struct riExit
  153. {
  154.     ULONG MethodID;    
  155. };
  156.  
  157. struct riInitIcon
  158. {
  159.     ULONG MethodID;
  160.     struct Window *ParentWin;    /* Window which is being iconified */
  161.     struct Task *WinTask;         /* Task that opened Window */
  162.     WORD    IconWidth;                /* Don't change this */
  163.     WORD    IconHeight;                /* You can change this */
  164.     APTR    UserData;                /* You can store something "local" to the Icon here */
  165. };
  166.  
  167. struct riRenderIcon
  168. {
  169.     ULONG MethodID;
  170.     struct Window *ParentWin;    /* Window this Icons belongs to */
  171.     struct Window *Icon;            /* The Icon is a Window! */
  172.     APTR    UserData;                /* Will be set to what you have stored here during RI_INITICON */
  173. };
  174.  
  175. struct riExitIcon
  176. {
  177.     ULONG MethodID;
  178.     APTR    UserData;                /* Will be set to what you have stored here during RI_INITICON */
  179. };
  180.  
  181. struct riRefreshIFrame
  182. {
  183.     ULONG MethodID;
  184.     struct Window *Icon;
  185.     APTR    UserData;                /* Will be set to what you have stored here during RI_INITICON */
  186. };
  187.  
  188. struct riRefreshITitle
  189. {
  190.     ULONG MethodID;
  191.     struct Window *Icon;
  192.     APTR    UserData;
  193. };
  194.  
  195. /*======================================================*/
  196.  
  197. /*==== All Messages in one ====*/
  198.  
  199. union PWMessage
  200. {
  201.     struct csInit pcsInit;
  202.     struct csExit pcsExit;
  203.     struct csCheck pcsCheck;
  204.     
  205.     struct cwInit pcwInit;
  206.     struct cwExit pcwExit;
  207.     struct cwCheck pcwCheck;
  208.     struct cwRenderIG pcwRenderIG;
  209.  
  210.     struct riInit priInit;
  211.     struct riExit priExit;
  212.     struct riInitIcon priInitIcon;
  213.     struct riRenderIcon priRenderIcon;
  214.     struct riExitIcon priExitIcon;
  215.     struct riRefreshIFrame priRefreshIFrame;
  216.     struct riRefreshITitle priRefreshITitle;
  217. };
  218.  
  219. /* Macros for easy Type-Casting */
  220.  
  221. #define CSINIT_Msg            ((struct csInit *)msg)
  222. #define CSEXIT_Msg            ((struct csExit *)msg)
  223. #define CSCHECK_Msg            ((struct csCheck *)msg)
  224.  
  225. #define CWINIT_Msg            ((struct cwInit *)msg)
  226. #define CWEXIT_Msg            ((struct cwExit *)msg)
  227. #define CWCHECK_Msg            ((struct cwCheck *)msg)
  228. #define CWRENDERIG_Msg        ((struct cwRenderIG *)msg)
  229.  
  230. #define RIINIT_Msg            ((struct riInit *)msg)
  231. #define RIEXIT_Msg            ((struct riExit *)msg)
  232. #define RIINITICON_Msg        ((struct riInitIcon *)msg)
  233. #define RIRENDERICON_Msg    ((struct riRenderIcon *)msg)
  234. #define RIEXITICON_Msg        ((struct riExitIcon *)msg)
  235. #define RIREFRESHIFRAME_Msg ((struct riRefreshIFrame *)msg)
  236. #define RIREFRESHITITLE_Msg ((struct riRefreshITitle *)msg)
  237.  
  238. /*==== Prototypes ====*/
  239.  
  240. LONG CheckScreen(Msg msg);
  241. LONG CheckWindow(Msg msg);
  242. LONG RenderIcon(Msg msg);
  243.  
  244.